3.241 \(\int \cos (a+b x) \sec (c+b x) \, dx\)

Optimal. Leaf size=26 \[ \frac {\sin (a-c) \log (\cos (b x+c))}{b}+x \cos (a-c) \]

[Out]

x*cos(a-c)+ln(cos(b*x+c))*sin(a-c)/b

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {4583, 3475, 8} \[ \frac {\sin (a-c) \log (\cos (b x+c))}{b}+x \cos (a-c) \]

Antiderivative was successfully verified.

[In]

Int[Cos[a + b*x]*Sec[c + b*x],x]

[Out]

x*Cos[a - c] + (Log[Cos[c + b*x]]*Sin[a - c])/b

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4583

Int[Cos[v_]*Sec[w_]^(n_.), x_Symbol] :> -Dist[Sin[v - w], Int[Tan[w]*Sec[w]^(n - 1), x], x] + Dist[Cos[v - w],
 Int[Sec[w]^(n - 1), x], x] /; GtQ[n, 0] && FreeQ[v - w, x] && NeQ[w, v]

Rubi steps

\begin {align*} \int \cos (a+b x) \sec (c+b x) \, dx &=\cos (a-c) \int 1 \, dx-\sin (a-c) \int \tan (c+b x) \, dx\\ &=x \cos (a-c)+\frac {\log (\cos (c+b x)) \sin (a-c)}{b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.12, size = 26, normalized size = 1.00 \[ \frac {\sin (a-c) \log (\cos (b x+c))}{b}+x \cos (a-c) \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[a + b*x]*Sec[c + b*x],x]

[Out]

x*Cos[a - c] + (Log[Cos[c + b*x]]*Sin[a - c])/b

________________________________________________________________________________________

fricas [A]  time = 0.54, size = 31, normalized size = 1.19 \[ \frac {b x \cos \left (-a + c\right ) - \log \left (-\cos \left (b x + c\right )\right ) \sin \left (-a + c\right )}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*sec(b*x+c),x, algorithm="fricas")

[Out]

(b*x*cos(-a + c) - log(-cos(b*x + c))*sin(-a + c))/b

________________________________________________________________________________________

giac [B]  time = 0.26, size = 440, normalized size = 16.92 \[ \frac {\frac {{\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} - \tan \left (\frac {1}{2} \, a\right )^{2} + 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, c\right )^{2} + 1\right )} {\left (b x + a\right )}}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} + \tan \left (\frac {1}{2} \, c\right )^{2} + 1} - \frac {{\left (\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right ) - \tan \left (\frac {1}{2} \, c\right )\right )} \log \left (\tan \left (b x + a\right )^{2} + 1\right )}{\tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} + \tan \left (\frac {1}{2} \, c\right )^{2} + 1} + \frac {2 \, {\left (\tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{4} + 2 \, \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right ) - 4 \, \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, a\right )^{2} - 2 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) + \tan \left (\frac {1}{2} \, c\right )^{2}\right )} \log \left ({\left | 2 \, \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right ) - 2 \, \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{2} + \tan \left (\frac {1}{2} \, a\right )^{2} \tan \left (\frac {1}{2} \, c\right )^{2} + 2 \, \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, a\right ) - \tan \left (\frac {1}{2} \, a\right )^{2} - 2 \, \tan \left (b x + a\right ) \tan \left (\frac {1}{2} \, c\right ) + 4 \, \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, c\right )^{2} + 1 \right |}\right )}{\tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right )^{3} - \tan \left (\frac {1}{2} \, a\right )^{3} \tan \left (\frac {1}{2} \, c\right )^{4} + \tan \left (\frac {1}{2} \, a\right )^{4} \tan \left (\frac {1}{2} \, c\right ) - \tan \left (\frac {1}{2} \, a\right ) \tan \left (\frac {1}{2} \, c\right )^{4} + \tan \left (\frac {1}{2} \, a\right )^{3} - \tan \left (\frac {1}{2} \, c\right )^{3} + \tan \left (\frac {1}{2} \, a\right ) - \tan \left (\frac {1}{2} \, c\right )}}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*sec(b*x+c),x, algorithm="giac")

[Out]

((tan(1/2*a)^2*tan(1/2*c)^2 - tan(1/2*a)^2 + 4*tan(1/2*a)*tan(1/2*c) - tan(1/2*c)^2 + 1)*(b*x + a)/(tan(1/2*a)
^2*tan(1/2*c)^2 + tan(1/2*a)^2 + tan(1/2*c)^2 + 1) - (tan(1/2*a)^2*tan(1/2*c) - tan(1/2*a)*tan(1/2*c)^2 + tan(
1/2*a) - tan(1/2*c))*log(tan(b*x + a)^2 + 1)/(tan(1/2*a)^2*tan(1/2*c)^2 + tan(1/2*a)^2 + tan(1/2*c)^2 + 1) + 2
*(tan(1/2*a)^4*tan(1/2*c)^2 - 2*tan(1/2*a)^3*tan(1/2*c)^3 + tan(1/2*a)^2*tan(1/2*c)^4 + 2*tan(1/2*a)^3*tan(1/2
*c) - 4*tan(1/2*a)^2*tan(1/2*c)^2 + 2*tan(1/2*a)*tan(1/2*c)^3 + tan(1/2*a)^2 - 2*tan(1/2*a)*tan(1/2*c) + tan(1
/2*c)^2)*log(abs(2*tan(b*x + a)*tan(1/2*a)^2*tan(1/2*c) - 2*tan(b*x + a)*tan(1/2*a)*tan(1/2*c)^2 + tan(1/2*a)^
2*tan(1/2*c)^2 + 2*tan(b*x + a)*tan(1/2*a) - tan(1/2*a)^2 - 2*tan(b*x + a)*tan(1/2*c) + 4*tan(1/2*a)*tan(1/2*c
) - tan(1/2*c)^2 + 1))/(tan(1/2*a)^4*tan(1/2*c)^3 - tan(1/2*a)^3*tan(1/2*c)^4 + tan(1/2*a)^4*tan(1/2*c) - tan(
1/2*a)*tan(1/2*c)^4 + tan(1/2*a)^3 - tan(1/2*c)^3 + tan(1/2*a) - tan(1/2*c)))/b

________________________________________________________________________________________

maple [B]  time = 1.57, size = 461, normalized size = 17.73 \[ \text {result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(b*x+a)*sec(b*x+c),x)

[Out]

1/b/(cos(a)^2*cos(c)^2+cos(a)^2*sin(c)^2+cos(c)^2*sin(a)^2+sin(a)^2*sin(c)^2)/(sin(a)*cos(c)-cos(a)*sin(c))*ln
(-tan(b*x+a)*cos(a)*sin(c)+tan(b*x+a)*sin(a)*cos(c)+cos(a)*cos(c)+sin(a)*sin(c))*cos(a)^2*sin(c)^2-2/b/(cos(a)
^2*cos(c)^2+cos(a)^2*sin(c)^2+cos(c)^2*sin(a)^2+sin(a)^2*sin(c)^2)/(sin(a)*cos(c)-cos(a)*sin(c))*ln(-tan(b*x+a
)*cos(a)*sin(c)+tan(b*x+a)*sin(a)*cos(c)+cos(a)*cos(c)+sin(a)*sin(c))*cos(a)*cos(c)*sin(a)*sin(c)+1/b/(cos(a)^
2*cos(c)^2+cos(a)^2*sin(c)^2+cos(c)^2*sin(a)^2+sin(a)^2*sin(c)^2)/(sin(a)*cos(c)-cos(a)*sin(c))*ln(-tan(b*x+a)
*cos(a)*sin(c)+tan(b*x+a)*sin(a)*cos(c)+cos(a)*cos(c)+sin(a)*sin(c))*cos(c)^2*sin(a)^2+1/2/b/(cos(c)^2+sin(c)^
2)/(cos(a)^2+sin(a)^2)*ln(1+tan(b*x+a)^2)*cos(a)*sin(c)-1/2/b/(cos(c)^2+sin(c)^2)/(cos(a)^2+sin(a)^2)*ln(1+tan
(b*x+a)^2)*sin(a)*cos(c)+1/b/(cos(c)^2+sin(c)^2)/(cos(a)^2+sin(a)^2)*cos(a)*cos(c)*arctan(tan(b*x+a))+1/b/(cos
(c)^2+sin(c)^2)/(cos(a)^2+sin(a)^2)*sin(a)*sin(c)*arctan(tan(b*x+a))

________________________________________________________________________________________

maxima [B]  time = 0.34, size = 74, normalized size = 2.85 \[ \frac {2 \, b x \cos \left (-a + c\right ) - \log \left (\cos \left (2 \, b x\right )^{2} + 2 \, \cos \left (2 \, b x\right ) \cos \left (2 \, c\right ) + \cos \left (2 \, c\right )^{2} + \sin \left (2 \, b x\right )^{2} - 2 \, \sin \left (2 \, b x\right ) \sin \left (2 \, c\right ) + \sin \left (2 \, c\right )^{2}\right ) \sin \left (-a + c\right )}{2 \, b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*sec(b*x+c),x, algorithm="maxima")

[Out]

1/2*(2*b*x*cos(-a + c) - log(cos(2*b*x)^2 + 2*cos(2*b*x)*cos(2*c) + cos(2*c)^2 + sin(2*b*x)^2 - 2*sin(2*b*x)*s
in(2*c) + sin(2*c)^2)*sin(-a + c))/b

________________________________________________________________________________________

mupad [B]  time = 1.04, size = 109, normalized size = 4.19 \[ x\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}}{2}-\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}}{2}\right )+x\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}}{2}+\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}}{2}\right )+\frac {\ln \left ({\mathrm {e}}^{a\,2{}\mathrm {i}-c\,2{}\mathrm {i}}+{\mathrm {e}}^{a\,2{}\mathrm {i}+b\,x\,2{}\mathrm {i}}\right )\,\left (\frac {{\mathrm {e}}^{-a\,1{}\mathrm {i}+c\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}-\frac {{\mathrm {e}}^{a\,1{}\mathrm {i}-c\,1{}\mathrm {i}}\,1{}\mathrm {i}}{2}\right )}{b} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(a + b*x)/cos(c + b*x),x)

[Out]

x*(exp(c*1i - a*1i)/2 - exp(a*1i - c*1i)/2) + x*(exp(c*1i - a*1i)/2 + exp(a*1i - c*1i)/2) + (log(exp(a*2i - c*
2i) + exp(a*2i + b*x*2i))*((exp(c*1i - a*1i)*1i)/2 - (exp(a*1i - c*1i)*1i)/2))/b

________________________________________________________________________________________

sympy [B]  time = 10.43, size = 435, normalized size = 16.73 \[ - \left (\begin {cases} - x & \text {for}\: c = \frac {\pi }{2} \\x & \text {for}\: c = - \frac {\pi }{2} \\0 & \text {for}\: b = 0 \\- \frac {2 b x \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} - 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} - 1} \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} - 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} - 1} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} + \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} + 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} + 1} \right )} \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {\log {\left (\tan {\left (\frac {b x}{2} \right )} + \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} + 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} + 1} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} & \text {otherwise} \end {cases}\right ) \sin {\relax (a )} + \left (\begin {cases} - \frac {\log {\left (\sin {\left (b x \right )} \right )}}{b} & \text {for}\: c = \frac {\pi }{2} \\\frac {\log {\left (\sin {\left (b x \right )} \right )}}{b} & \text {for}\: c = - \frac {\pi }{2} \\\frac {x}{\cos {\relax (c )}} & \text {for}\: b = 0 \\- \frac {b x \tan ^{2}{\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {b x}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} + \frac {2 \log {\left (\tan ^{2}{\left (\frac {b x}{2} \right )} + 1 \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {2 \log {\left (\tan {\left (\frac {b x}{2} \right )} - \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} - 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} - 1} \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} - \frac {2 \log {\left (\tan {\left (\frac {b x}{2} \right )} + \frac {\tan {\left (\frac {c}{2} \right )}}{\tan {\left (\frac {c}{2} \right )} + 1} - \frac {1}{\tan {\left (\frac {c}{2} \right )} + 1} \right )} \tan {\left (\frac {c}{2} \right )}}{b \tan ^{2}{\left (\frac {c}{2} \right )} + b} & \text {otherwise} \end {cases}\right ) \cos {\relax (a )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(b*x+a)*sec(b*x+c),x)

[Out]

-Piecewise((-x, Eq(c, pi/2)), (x, Eq(c, -pi/2)), (0, Eq(b, 0)), (-2*b*x*tan(c/2)/(b*tan(c/2)**2 + b) - log(tan
(b*x/2)**2 + 1)*tan(c/2)**2/(b*tan(c/2)**2 + b) + log(tan(b*x/2)**2 + 1)/(b*tan(c/2)**2 + b) + log(tan(b*x/2)
- tan(c/2)/(tan(c/2) - 1) - 1/(tan(c/2) - 1))*tan(c/2)**2/(b*tan(c/2)**2 + b) - log(tan(b*x/2) - tan(c/2)/(tan
(c/2) - 1) - 1/(tan(c/2) - 1))/(b*tan(c/2)**2 + b) + log(tan(b*x/2) + tan(c/2)/(tan(c/2) + 1) - 1/(tan(c/2) +
1))*tan(c/2)**2/(b*tan(c/2)**2 + b) - log(tan(b*x/2) + tan(c/2)/(tan(c/2) + 1) - 1/(tan(c/2) + 1))/(b*tan(c/2)
**2 + b), True))*sin(a) + Piecewise((-log(sin(b*x))/b, Eq(c, pi/2)), (log(sin(b*x))/b, Eq(c, -pi/2)), (x/cos(c
), Eq(b, 0)), (-b*x*tan(c/2)**2/(b*tan(c/2)**2 + b) + b*x/(b*tan(c/2)**2 + b) + 2*log(tan(b*x/2)**2 + 1)*tan(c
/2)/(b*tan(c/2)**2 + b) - 2*log(tan(b*x/2) - tan(c/2)/(tan(c/2) - 1) - 1/(tan(c/2) - 1))*tan(c/2)/(b*tan(c/2)*
*2 + b) - 2*log(tan(b*x/2) + tan(c/2)/(tan(c/2) + 1) - 1/(tan(c/2) + 1))*tan(c/2)/(b*tan(c/2)**2 + b), True))*
cos(a)

________________________________________________________________________________________